package com.activitycode.adapter;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RatingBar;
import android.widget.TextView;

import com.activitycode.adapter.OtherServiceAdapter.ViewHolder;
import com.activitycode.datamodel.ground.Category;
import com.duostec.zhuyue.pets.R;
import com.nostra13.universalimageloader.core.ImageLoader;

public class GroundListAdapter extends BaseAdapter {
	private Context context;
	private GroundListAdapter adapter;
	private ImageLoader imageLoader = ImageLoader.getInstance();
	private List<String> list;
	public GroundListAdapter( List<String> list ,Context context){
		this.context=context;
		this.list=list;
		adapter=this;
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return list.size()-5;
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return list.get(position)+5;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position+5;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup arg2) {
		
		ViewHolder viewHolder = null;
		if (convertView == null) {
			viewHolder = new ViewHolder();
			convertView = LayoutInflater.from(context).inflate(
					R.layout.adapter_ground_item, null);
			viewHolder.sate_name = (TextView) convertView
					.findViewById(R.id.cate_textView1);
			
			convertView.setTag(viewHolder);
		} else {

			viewHolder = (ViewHolder) convertView.getTag();
		}
		viewHolder.sate_name.setText(list.get(position+5));
		return convertView;
	}
	public final static class ViewHolder {
		TextView sate_name;
		
	}
}
